home *** CD-ROM | disk | FTP | other *** search
/ Nautilus 1992 July / Nautilus-3-8 / Nautilus-3-8.bin / Tools & Utilities / Techy Stuff / Doco ƒ / CSMP ƒ / CSMP-V1-095.TXT < prev    next >
Encoding:
Text File  |  1992-06-30  |  77.1 KB  |  2,062 lines

  1. C.S.M.P. Digest             Tue, 26 May 92       Volume 1 : Issue 95
  2.  
  3. Today's Topics:
  4.  
  5.     How do I find out if Multi-finder is running??
  6.  
  7.  
  8. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  9.  
  10. These digests are available (by using FTP, account anonymous, your email
  11. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  12. edu.  This is also the home of the comp.sys.mac.programmer Frequently Asked
  13. Questions list.  The last several issues of the digest are available from
  14. sumex-aim.stanford.edu as well.
  15.  
  16. These digests are also available via email.  Just send a note saying that you
  17. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  18. automatically receive each new digest as it is created.
  19.  
  20. The digest is a collection of articles from the internet newsgroup comp.sys.
  21. mac.programmer.  It is designed for people who read c.s.m.p. semi-regularly
  22. and want an archive of the discussions.  If you don't know what a newsgroup
  23. is, you probably don't have access to it.  Ask your systems administrator(s)
  24. for details.  (This means you can't post questions to the digest.)
  25.  
  26. The articles in these digests are taken directly from comp.sys.mac.programmer.
  27. They are not edited; all articles included in this digest are in their original
  28. posted form.  The only articles that are -not- included in these digests are
  29. those which didn't receive any replies (except those that give information
  30. rather than ask a question).  All replies to each article are concatenated
  31. onto the original article in the order in which they were received.  Article
  32. threads are not added to the digests until the last article added to the
  33. thread is at least one month old (this is to ensure that the thread is dead
  34. before adding it to the digests).
  35.  
  36. Send administrative mail to mkelly@cs.uoregon.edu.
  37.  
  38. -------------------------------------------------------
  39.  
  40. From: ma9cjh@gdt.bath.ac.uk (C J Hall)
  41. Subject: How do I find out if Multi-finder is running??
  42. Date: 17 Feb 92 15:36:52 GMT
  43. Organization: School of Mathematics, University of Bath, UK
  44.  
  45. Hi,
  46.     Sorry if this is a FAQ, but I would like to be able 
  47. to determine whether or not multi-finder is running or not.
  48. I am hoping that all I have to do is just test a global flag,
  49. or similar.
  50. Thanks in advance
  51.  
  52. Chris
  53.  
  54. - --------------------------------------------------------
  55. Chris Hall is ma9cjh@maths.bath.ac.uk 
  56.  " As ye live by the sword so shall ye die by the sword."
  57. - --------------------------------------------------------
  58.  
  59.  
  60.  
  61. - -------------------------
  62.  
  63. From: nick@dcs.ed.ac.uk (Nick Rothwell)
  64. Subject:  How do I find out if Multi-finder is running??
  65. Date: 17 Feb 92 17:22:43 GMT
  66. Organization: Friends of the Salter Duck
  67.  
  68. Yes, it is (or, at least, was) a FAQ.
  69.  
  70. MultiFinder is not "running" - it is obsolete.
  71.  
  72. System 7.0 is always running. To all intents and purposes, that provides
  73. MultiFinder. The answer to your question is therefore "always."
  74.  
  75. (If you're only using System 6.0, I'd advise you to regard MultiFinder as
  76. always running as well - software which can't handle it is doomed to
  77. obsolescence.)
  78.  
  79. Final point: why do you want to know? I've *never* heard anybody give
  80. me a convincing reason. It's like saying, "is there a flag which tells
  81. me whether there are any Post-It notes attached to the case of this
  82. Macintosh?" Why does it matter?
  83.  
  84. Nick.
  85. --
  86. Nick Rothwell, LFCS, Edinburgh | "Chai ch t'chai ch't chnna chnna chnna ch'th
  87.              nick@dcs.ed.ac.uk |  Chai ch t'chai ch't chuth chena chann ch'tt
  88. Mentation Consultancy Services |  Chie ch t'chie ch t'chaaa chn chattr chattr"
  89.    cassiel@cix.compulink.co.uk |       -- Wavestation, V3 software, my dragon.
  90.  
  91.  
  92.  
  93. - -------------------------
  94.  
  95. From: dcastell@csg.uwaterloo.ca (David Castell)
  96. Subject:  How do I find out if Multi-finder is running??
  97. Date: 18 Feb 92 15:05:35 GMT
  98. Organization: Computer Systems Group
  99.  
  100. In article <NICK.GNUS194@dcs.ed.ac.uk>, nick@dcs.ed.ac.uk (Nick Rothwell) writes:
  101. > Yes, it is (or, at least, was) a FAQ.
  102. > MultiFinder is not "running" - it is obsolete.
  103. > System 7.0 is always running. To all intents and purposes, that provides
  104. > MultiFinder. The answer to your question is therefore "always."
  105. > (If you're only using System 6.0, I'd advise you to regard MultiFinder as
  106. > always running as well - software which can't handle it is doomed to
  107. > obsolescence.)
  108. > Final point: why do you want to know? I've *never* heard anybody give
  109. > me a convincing reason. It's like saying, "is there a flag which tells
  110. > me whether there are any Post-It notes attached to the case of this
  111. > Macintosh?" Why does it matter?
  112. > Nick.
  113. > --
  114.  
  115. I have to disagree with your assessment that MultiFinder is obsolete.  When
  116. dealing with the educational market, we always have to be aware of the many
  117. schools out there who are still running 1 meg Mac Pluses off of floppies.
  118. (Some are actually still using 512e's with system 4).  Most of these people
  119. are still using the Finder and don't want to switch to MultiFinder.
  120.  
  121. In the past I have had to tell whether MultiFinder is running, so I guess
  122. I might as well give you a chance to shoot down my reason :)
  123. I wanted to have the ability for one workstation on the network force the
  124. launch of a program on other workstations (eg. a teacher might want to have
  125. all machines load a program for the next class).  However, the workstation
  126. code should not attempt a launch if MultiFinder is not running and the
  127. Finder is not the currently running program.  Otherwise, someone might be
  128. in Word and lose their work when I launched.  If MultiFinder was running it
  129. would not matter if someone was using Word because it would still stay
  130. running after the launch.  In general, I agree with you that it doesn't
  131. matter which is running.  However, I have found launching to be an exception.
  132.  
  133. I response to the original poster:  There is an easy way to determine if
  134. MultiFinder (or the multi-program environment of System 7) which I have
  135. never seen described elsewhere .  Just check to see if trap $A88F is
  136. implemented.  This trap was called 'JugglerDispatch' under MultiFinder and
  137. is now officially 'OSDispatch' under System 7.  It is unimplemented in the
  138. Finder.
  139.  
  140. Now that you have the ability to tell what is running, I want to second
  141. Nick's advice.  Please don't write software that only runs under Finder.
  142. If your program does not work under MultiFinder or insists that only the
  143. Finder can run, it is useless.
  144.  
  145. Dave Castell
  146. Computer Systems Group
  147.  
  148.  
  149.  
  150. - -------------------------
  151.  
  152. From: wombat@claris.com (Scott Lindsey)
  153. Subject:  How do I find out if Multi-finder is running??
  154. Date: 18 Feb 92 22:02:21 GMT
  155. Organization: Claris Corporation
  156.  
  157. In article <1992Feb18.150535.29619@watserv1.waterloo.edu>, dcastell@csg.uwaterloo.ca (David Castell) writes:
  158. > I response to the original poster:  There is an easy way to determine if
  159. > MultiFinder (or the multi-program environment of System 7) which I have
  160. > never seen described elsewhere .  Just check to see if trap $A88F is
  161. > implemented.  This trap was called 'JugglerDispatch' under MultiFinder and
  162. > is now officially 'OSDispatch' under System 7.  It is unimplemented in the
  163. > Finder.
  164.  
  165. It's documented in the MultiFinder programmer's guide (or whatever it was called).
  166. In there, it's described as _MFMemoryTrap, through which you can get temporary
  167. memory in MultiFinder's heap.  Here's how I check for it:
  168.  
  169.     Boolean MultiFinder;
  170.  
  171.     if (!Gestalt(gestaltOSAttr, &response))
  172.         MultiFinder = !!(response & 1<<gestaltTempMemSupport);
  173.     else    // Gestalt said no.
  174.         MultiFinder = TrapIsImplemented(_MFMemoryTrap);
  175.  
  176.  
  177. --
  178. Scott Lindsey <wombat@claris.com>
  179.  
  180.  
  181.  
  182. - -------------------------
  183.  
  184. From: nick@dcs.ed.ac.uk (Nick Rothwell)
  185. Subject:  How do I find out if Multi-finder is running??
  186. Date: 19 Feb 92 11:40:49 GMT
  187. Organization: Friends of the Salter Duck
  188.  
  189. In article <1992Feb18.150535.29619@watserv1.waterloo.edu> dcastell@csg.uwaterloo.ca (David Castell) writes:
  190.  
  191.    I have to disagree with your assessment that MultiFinder is
  192.    obsolete.
  193.  
  194. Maybe I should rephrase: software which can't deal with MultiFinder is
  195. dooming itself to obsolescence. All my code will happily run without
  196. MultiFinder (or System 7.0), but if that was a requirement, it would
  197. be useless.
  198.  
  199.    In the past I have had to tell whether MultiFinder is running, so I guess
  200.    I might as well give you a chance to shoot down my reason :)
  201.  
  202. OK, fire away...
  203.  
  204.    I wanted to have the ability for one workstation on the network
  205.    force the launch of a program on other workstations (eg. a teacher
  206.    might want to have all machines load a program for the next class).
  207.    However, the workstation code should not attempt a launch if
  208.    MultiFinder is not running and the Finder is not the currently
  209.    running program.  Otherwise, someone might be in Word and lose
  210.    their work when I launched.
  211.  
  212. OK, what you're after here is a "can I safely launch other programs"
  213. test. Now, I'm not going to suggest that there should be traps for
  214. every such thing (or "will a DA have its own layer" or "are the desktop
  215. icons always visible" or ...) but the general point is that you're
  216. after specific information about the environment, and you don't
  217. actually want to know about MultiFinder running at all. Suppose, for
  218. example, it were possible to queue a launch under UniFinder for when
  219. something else quits. Then, testing for MultiFinder would be the wrong
  220. thing to do in your case.
  221.  
  222. Nick.
  223. --
  224. Nick Rothwell, LFCS, Edinburgh | "Chai ch t'chai ch't chnna chnna chnna ch'th
  225.              nick@dcs.ed.ac.uk |  Chai ch t'chai ch't chuth chena chann ch'tt
  226. Mentation Consultancy Services |  Chie ch t'chie ch t'chaaa chn chattr chattr"
  227.    cassiel@cix.compulink.co.uk |       -- Wavestation, V3 software, my dragon.
  228.  
  229.  
  230.  
  231. - -------------------------
  232.  
  233. From: quinn@cs.uwa.oz.au (Quinn "The Eskimo!")
  234. Subject:  How do I find out if Multi-finder is running??
  235. Organization: The University of Western Australia
  236. Date: Thu, 20 Feb 1992 01:24:11 GMT
  237.  
  238. In article <NICK.GNUS199@dcs.ed.ac.uk>, nick@dcs.ed.ac.uk (Nick Rothwell) writes:
  239. > In article <1992Feb18.150535.29619@watserv1.waterloo.edu> dcastell@csg.uwaterloo.ca (David Castell) writes:
  240. >    However, the workstation code should not attempt a launch if
  241. >    MultiFinder is not running and the Finder is not the currently
  242. >    running program.  Otherwise, someone might be in Word and lose
  243. >    their work when I launched.
  244. > OK, what you're after here is a "can I safely launch other programs"
  245. > test.
  246.  
  247. How about testing the gestaltLaunchCanReturn bit of the response from
  248. the gestaltOSAttr selector.  It works for MultiFinder 6.0.5 and greater
  249. (I think - it definitely works on >= 6.0.7) (be wary of MultiFinder
  250. 6.1b9 though).
  251.  
  252. Quinn "The Eskimo!"   <quinn@cs.uwa.oz.au>   "Real Coke, Diet .sig"
  253. Department of Computer Science, The University of Western Australia
  254.  
  255.  
  256.  
  257.  
  258. - -------------------------
  259.  
  260. From: Pete.Gontier@p811.f70.n109.z1.FidoNet.Org (Pete Gontier)
  261. Subject:  How do I find out if Multi-finder is running??
  262. Date: 20 Feb 92 01:54:58 GMT
  263.  
  264.  
  265.  DC> From: dcastell@csg.uwaterloo.ca (David Castell)
  266.  
  267.  DC> I response to the original poster:  There is an easy way to determine if
  268.  DC> MultiFinder (or the multi-program environment of System 7) which I have
  269.  DC> never seen described elsewhere .  Just check to see if trap $A88F is
  270.  DC> implemented.  This trap was called 'JugglerDispatch' under MultiFinder
  271.  DC> and is now officially 'OSDispatch' under System 7.  It is unimplemented in
  272.  DC> the Finder.
  273.  
  274. Jeez, I think I know too much about this topic, both good and bad.
  275.  
  276. 1.bad) Yes, this method is acknowledged by Apple employees. The acknowledgement takes the form: "You might be tempted to do this, but don't. We might implement _OSDispatch under UniFinder just to foil this strategy." I've heard this so far from two who shall go nameless. (I don't know how the Apple Internal Thought Police operate.)
  277.  
  278. 2.good) Aside from just hoping that this undocumented behavior stays this way forever, you might take some comfort in knowing that all sorts of Apple programs check for MultiFinder this way. Does this make it any better a practice? No. Apple has all sorts of opportunity to fix these naughty programs because of course they know before everyone else when the System is about to be updated. So they have special privelege. However, tracking down all the instances of such stuff would not be any fun.
  279.  
  280. 3.bad) The last time I discussed this strategy in public, one of the System 7
  281. teamsters piped up and assured me that although this strategy was against
  282. the rules, it would probably work forever, because there most likely would
  283. never be a System 6.0.8. Two months later, there was. Even worse: MacWeek
  284. made noise recently about the next generation of low-end machines
  285. running something akin to System 6.0.9 -- which supposedly will implement
  286. some System 7 functionality (hope y'all've been calling Gestalt like good
  287. little boys and girls). With changes like that, _OSDispatch could easily be implemented under UniFinder. (So I suppose #2 isn't such a reassurance after
  288. all, eh?)
  289.  
  290. 4.weird) I once heard here on UseNet that calling PtrZone on the window
  291. manager port was fairly educational -- if it doesn't live in your app's
  292. zone, you've got MultiFinder. Never tried it, though.
  293.  * Origin: EC Technology, Santa Barbara, CA (1:109/70.811)
  294.  
  295.  
  296.  
  297. - -------------------------
  298.  
  299. From: jeremyr@dcs.qmw.ac.uk (Jeremy Roussak)
  300. Subject:  How do I find out if Multi-finder is running??
  301. Date: 20 Feb 92 21:40:07 GMT
  302. Organization: Computer Science Dept, QMW, University of London
  303.  
  304. In <698576416.0@blkcat.FidoNet> Pete.Gontier@p811.f70.n109.z1.FidoNet.Org (Pete Gontier) writes:
  305.  
  306. >4.weird) I once heard here on UseNet that calling PtrZone on the window
  307. >manager port was fairly educational -- if it doesn't live in your app's
  308. >zone, you've got MultiFinder. Never tried it, though.
  309.  
  310. I've used this for an INIT: it works very well.  The only catch
  311. is that DA Handler runs with TheZone set to SysZone, so
  312. PtrZone(WMgrPort) does equal TheZone.
  313.  
  314. Jeremy Roussak
  315.  
  316.  
  317.  
  318. - -------------------------
  319.  
  320. From: lsr@apple.com (Larry Rosenstein)
  321. Subject:  How do I find out if Multi-finder is running??
  322. Date: 25 Feb 92 03:11:26 GMT
  323. Organization: Taligent Inc.
  324.  
  325. Before discussing the pros and cons, it is important to understand why the
  326. "party line" is that you should never test for MultiFinder running.  Answering
  327. the question "Is MultiFinder running?" only answers that question.  But in 99%
  328. of the cases, the REAL question that people want answered is something else. 
  329. (For example, "Will the _Launch trap return?")
  330.  
  331. People assume that answerin the question about MultiFinder IMPLIES the answer to
  332. the other question.  Making assumptions like this is a major source of
  333. incompatibilities.  (How many programs have broken because they assumed that Mac
  334. II-like machine implies a machine with an FPU?)
  335.  
  336. In article <698576416.0@blkcat.FidoNet>,
  337. Pete.Gontier@p811.f70.n109.z1.FidoNet.Org (Pete Gontier) writes:
  338. > 1.bad) Yes, this method is acknowledged by Apple employees. The
  339. acknowledgement takes the form: "You might be tempted to do this, but don't. We
  340. might implement _OSDispatch under UniFinder just to foil this strategy." 
  341.  
  342. I think testing for MultiFinder temporary memory (which I believe is different
  343. from testing for the trap) is probably the best way to determine if MultiFinder
  344. is running.  Testing the zone containing the WmgrPort, or looking at the Apple
  345. menu is probably a bad way.
  346.  
  347. > the rules, it would probably work forever, because there most likely would
  348. > never be a System 6.0.8. Two months later, there was. Even worse: MacWeek
  349.  
  350. 6.0.8 is the exact same system; only the printer drivers changed.
  351.  
  352. I don't think Apple would implement the MultiFinder trap just to screw up
  353. people, but WaitNextEvent started out as MultiFinder-only and then was
  354. implemented all the time.
  355.  
  356. The most important thing, however, is to recognize what kind of assumption you
  357. are making (whether it's based on the existence of the MultiFinder trap or the
  358. zone containing WmgrPort), and decide for yourself the chance of that assumption
  359. being violated in the future.  The same advice applies when writing INITs or
  360. patching traps.
  361. --
  362. Larry Rosenstein
  363. lsr@apple.com
  364.  
  365.  
  366.  
  367.  
  368. - -------------------------
  369.  
  370. From: kent@sunfs3.Camex.COM (Kent Borg)
  371. Subject:  How do I find out if Multi-finder is running??
  372. Organization: Camex Inc., Boston MA
  373. Date: Sun, 01 Mar 1992 12:56:14 EST
  374.  
  375. In article <20738@goofy.Apple.COM> lsr@apple.com (Larry Rosenstein) writes:
  376. >(How many programs have broken because they assumed that Mac
  377. >II-like machine implies a machine with an FPU?)
  378.  
  379. A "Fun Fact" I can't resist posting.  As I sit here typing on an
  380. FPU-less 140, with an FPU-less IIsi two feet away, I am quite sure I
  381. once heard an Apple Engineer on the podium at a Developers' Conference
  382. say that all future '020-or-better Macs would have math chips.  He was
  383. wrong.
  384.  
  385. Why post this?  First, because poking fun is fun, but second to try to
  386. enhance the sense of paranoia which should be in everybody who
  387. programs Macintoshes.  What assumptions are you making?  How many of
  388. them will be proved bad?
  389.  
  390. --
  391. Kent Borg                            internet: kent@camex.com   AOL: kent borg
  392.                                             H:(617) 776-6899  W:(617) 426-3577
  393. "Eating healthy beef is not healthful, the steer will take offense at you
  394. chewing on his flanks."      -me
  395.  
  396.  
  397.  
  398. +++++++++++++++++++++++++++
  399.  
  400. From: ksand@apple.com (Kent Sandvik)
  401. Date: 8 Mar 92 01:46:52 GMT
  402. Organization: MacDTS Mongols
  403.  
  404. In article <1992Mar01.125614.6010@sunfs3.Camex.COM>, kent@sunfs3.Camex.COM (Kent
  405. Borg) writes:
  406. > In article <20738@goofy.Apple.COM> lsr@apple.com (Larry Rosenstein) writes:
  407. > >(How many programs have broken because they assumed that Mac
  408. > >II-like machine implies a machine with an FPU?)
  409. > A "Fun Fact" I can't resist posting.  As I sit here typing on an
  410. > FPU-less 140, with an FPU-less IIsi two feet away, I am quite sure I
  411. > once heard an Apple Engineer on the podium at a Developers' Conference
  412. > say that all future '020-or-better Macs would have math chips.  He was
  413. > wrong.
  414.  
  415. The unofficial and official DTS standpoint is that *never* assume that
  416. an FPU is installed. Use Gestalt to check for this, now and forever.
  417.  
  418. Cheers,
  419. Kent
  420.  
  421. - ----
  422. - --
  423. Kent Sandvik - Apple DTS  - Dynamic Language Evangelist
  424. ksand@apple.com
  425. All opinions expressed are my own, and not related to any company or
  426. organization. 
  427. Happy, happy, joy, joy!
  428.  
  429. +++++++++++++++++++++++++++
  430.  
  431. From: nick@dcs.ed.ac.uk (Nick Rothwell)
  432. Date: 12 Mar 92 12:38:59 GMT
  433. Organization: Friends of the Salter Duck
  434.  
  435. In article <21230@goofy.Apple.COM> ksand@apple.com (Kent Sandvik) writes:
  436.  
  437.    The unofficial and official DTS standpoint is that *never* assume that
  438.    an FPU is installed. Use Gestalt to check for this, now and forever.
  439.  
  440. Er, but: can you always assume that *Gestalt* is installed on all
  441. machines? :-)
  442.  
  443. Nick.
  444. - --
  445. Nick Rothwell, LFCS, Edinburgh |         Tips to confuse a vegetarian #6:
  446.              nick@dcs.ed.ac.uk |           serve a venus flytrap salad.
  447. Mentation Consultancy Services |
  448.    cassiel@cix.compulink.co.uk | ("You mean it's a vegetable but it eats meat?")
  449.  
  450. +++++++++++++++++++++++++++
  451.  
  452. From: jcav@quads.uchicago.edu (JohnC)
  453. Organization: The Royal Society for Putting Things on Top of Other Things
  454. Date: Thu, 12 Mar 1992 18:01:31 GMT
  455.  
  456. In article <NICK.92Mar12123859@vaila.ed.ac.uk> nick@dcs.ed.ac.uk (Nick Rothwell) writes:
  457. >In article <21230@goofy.Apple.COM> ksand@apple.com (Kent Sandvik) writes:
  458. >
  459. >   The unofficial and official DTS standpoint is that *never* assume that
  460. >   an FPU is installed. Use Gestalt to check for this, now and forever.
  461. >
  462. >Er, but: can you always assume that *Gestalt* is installed on all
  463. >machines? :-)
  464.  
  465. The _Gestalt glue checks for the presence of the trap, and emulates many
  466. functions, including the FPU check, even if the trap is absent.  You can
  467. also use _SysEnvirons.  And if _SysEnvirons isn't available then you're
  468. working with a hopelessly out-dated version of the system.
  469.  
  470. - -- 
  471. John Cavallino                  |  EMail: jcav@midway.uchicago.edu
  472. University of Chicago Hospitals |         John_Cavallino@uchfm.bsd.uchicago.edu
  473. Office of Facilities Management | USMail: 5841 S. Maryland Ave, MC 0953
  474. B0 f++ c+ g+ k s+(+) e+ h- pv   |         Chicago, IL  60637
  475.  
  476. +++++++++++++++++++++++++++
  477.  
  478. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  479. Organization: Kalamazoo College
  480. Date: Thu, 12 Mar 1992 21:22:52 GMT
  481.  
  482. jcav@midway.uchicago.edu writes:
  483. >
  484. >The _Gestalt glue checks for the presence of the [Gestalt] trap...
  485.  
  486. Only if you're in MPW, remember.  Think C users must do the check.
  487. - -- 
  488.  Jamie McCarthy     Internet: k044477@kzoo.edu     AppleLink: j.mccarthy
  489.  Kzoo randomly kills all my mail;  if I don't acknowledge, try resending.    
  490.  
  491. +++++++++++++++++++++++++++
  492.  
  493. From: jcav@quads.uchicago.edu (JohnC)
  494. Organization: The Royal Society for Putting Things on Top of Other Things
  495. Date: Thu, 12 Mar 1992 22:06:42 GMT
  496.  
  497. In article <1992Mar12.212252.28943@hobbes.kzoo.edu> k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:
  498. >jcav@midway.uchicago.edu writes:
  499. >>
  500. >>The _Gestalt glue checks for the presence of the [Gestalt] trap...
  501. >
  502. >Only if you're in MPW, remember.  Think C users must do the check.
  503.  
  504. As far as I am aware, the THINK languages use Apple's (MPW) Toolbox interface
  505. glue.  If you're running the latest versions of THINK C or THINK Pascal,
  506. you do in fact have the _Gestalt glue that checks for the presence of the
  507. trap.
  508.  
  509. - -- 
  510. John Cavallino                  |  EMail: jcav@midway.uchicago.edu
  511. University of Chicago Hospitals |         John_Cavallino@uchfm.bsd.uchicago.edu
  512. Office of Facilities Management | USMail: 5841 S. Maryland Ave, MC 0953
  513. B0 f++ c+ g+ k s+(+) e+ h- pv   |         Chicago, IL  60637
  514.  
  515. +++++++++++++++++++++++++++
  516.  
  517. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  518. Organization: Kalamazoo College
  519. Date: Fri, 13 Mar 1992 00:17:42 GMT
  520.  
  521. jcav@midway.uchicago.edu writes:
  522. >k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:
  523. >>jcav@midway.uchicago.edu writes:
  524. >>>
  525. >>>The _Gestalt glue checks for the presence of the [Gestalt] trap...
  526. >>
  527. >>Only if you're in MPW, remember.  Think C users must do the check.
  528. >
  529. >As far as I am aware, the THINK languages use Apple's (MPW) Toolbox interface
  530. >glue.  If you're running the latest versions of THINK C or THINK Pascal,
  531. >you do in fact have the _Gestalt glue that checks for the presence of the
  532. >trap.
  533.  
  534. I don't think so.  I tested this a few months ago with ThC 5.0.2 and the
  535. then-current MPW headers, and I just tried again with the current (4 Dec
  536. 1991) GestaltEqu.h.  The "Mac #includes" shipped in the box doesn't
  537. #define either SystemSixOrLater or SystemSevenOrLater, so it's not
  538. leaving out the tests because of that.
  539.  
  540. With <MacHeaders> in the prefix, I gave the disassembler:
  541.  
  542. #include <GestaltEqu.h>
  543. int fred(void);
  544. int fred()
  545. {
  546.     OSErr theOSErr; long r;
  547.     theOSErr = Gestalt(gestaltMachineType, &r);
  548. }
  549.  
  550. ...and it told me:
  551.  
  552. 00000004        CLR.W     -(A7)
  553. 00000006        MOVE.L    #$6D616368,-(A7); 'mach'
  554. 0000000C        PEA       $FFFC(A6)
  555. 00000010        JSR       $0000(A5)
  556. 00000014        MOVE.W    (A7)+,$FFFA(A6)
  557.  
  558. Unless something fishy's going on, there's no test for _Gestalt.
  559. - -- 
  560.  Jamie McCarthy     Internet: k044477@kzoo.edu     AppleLink: j.mccarthy
  561.  Kzoo randomly kills all my mail;  if I don't acknowledge, try resending.    
  562.  
  563. +++++++++++++++++++++++++++
  564.  
  565. From: resnick@cogsci.uiuc.edu (Pete Resnick)
  566. Organization: University of Illinois at Urbana
  567. Date: Fri, 13 Mar 1992 00:47:19 GMT
  568.  
  569. k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:
  570.  
  571. >    OSErr theOSErr; long r;
  572. >    theOSErr = Gestalt(gestaltMachineType, &r);
  573.  
  574. >00000004        CLR.W     -(A7)
  575. >00000006        MOVE.L    #$6D616368,-(A7); 'mach'
  576. >0000000C        PEA       $FFFC(A6)
  577. >00000010        JSR       $0000(A5)
  578.                  ^^^^^^^^^^^^^^^^^^^
  579. >00000014        MOVE.W    (A7)+,$FFFA(A6)
  580.  
  581. >Unless something fishy's going on, there's no test for _Gestalt.
  582.  
  583. The JSR there is your test for Gestalt. It is going to jump to some
  584. glue which will be added at link time, which is why it is set to 
  585. 0 off of A5. If it was using the trap instead of the glue, you would
  586. have seen "DC.W $A1AD" instead.
  587.  
  588. pr
  589. - --
  590. Pete Resnick             (...so what is a mojo, and why would one be rising?)
  591. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  592. System manager - Cognitive Science Group, Beckman Institute, UIUC
  593. Internet: resnick@cogsci.uiuc.edu
  594.  
  595. +++++++++++++++++++++++++++
  596.  
  597. From: d88-jwa@byse.nada.kth.se (Jon W{tte)
  598. Organization: Royal Institute of Technology, Stockholm, Sweden
  599. Date: Fri, 13 Mar 1992 16:48:44 GMT
  600.  
  601. .kzoo.edu> k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:
  602.  
  603.    With <MacHeaders> in the prefix, I gave the disassembler:
  604.  
  605.    #include <GestaltEqu.h>
  606.    int fred(void);
  607.    int fred()
  608.    {
  609.        OSErr theOSErr; long r;
  610.        theOSErr = Gestalt(gestaltMachineType, &r);
  611.    }
  612.  
  613.    ...and it told me:
  614.  
  615.    00000004        CLR.W     -(A7)
  616.    00000006        MOVE.L    #$6D616368,-(A7); 'mach'
  617.    0000000C        PEA       $FFFC(A6)
  618.    00000010        JSR       $0000(A5)
  619.    00000014        MOVE.W    (A7)+,$FFFA(A6)
  620.  
  621.    Unless something fishy's going on, there's no test for _Gestalt.
  622.  
  623.  
  624. If it DIDN'T check for the trap, that JSR would have been the trap
  625. number. Now it's a JSR, because the check for the trap is in the
  626. glue code (MacTraps)
  627.  
  628. - -- 
  629. This signature is placed into the Public Domain by Jon W{tte (h+@nada.kth.se)
  630.                      - The worlds only romantic cynic -
  631.  
  632. +++++++++++++++++++++++++++
  633.  
  634. From: d88-jwa@byse.nada.kth.se (Jon W{tte)
  635. Date: 13 Mar 92 17:01:21 GMT
  636. Organization: Royal Institute of Technology, Stockholm, Sweden
  637.  
  638. .kzoo.edu> k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:
  639.  
  640.    >The _Gestalt glue checks for the presence of the [Gestalt] trap...
  641.  
  642.    Only if you're in MPW, remember.  Think C users must do the check.
  643.  
  644.  
  645. You haven't upgraded Think C lately, have you ? Think C 5.0 glue
  646. does most definately check for the trap.
  647.  
  648. - -- 
  649. This signature is placed into the Public Domain by Jon W{tte (h+@nada.kth.se)
  650.                      - The worlds only romantic cynic -
  651.  
  652. +++++++++++++++++++++++++++
  653.  
  654. From: REEKES@applelink.apple.com (Jim Reekes)
  655. Date: 20 Mar 92 20:20:16 GMT
  656. Organization: Apple Computer, Inc.
  657.  
  658. In article <1992Mar12.212252.28943@hobbes.kzoo.edu>, k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:
  659. > jcav@midway.uchicago.edu writes:
  660. > >
  661. > >The _Gestalt glue checks for the presence of the [Gestalt] trap...
  662. > Only if you're in MPW, remember.  Think C users must do the check.
  663.  
  664. I just built a small test program in Think C 5.0, and it does in deed
  665. check for the presence of the Gestalt Trap.  Think uses the MPW libraries
  666. from Apple for toolbox interfaces.
  667.  
  668.  
  669. - -----------------------------------------------------------------------
  670. Jim Reekes, E.O.             |     Macintosh Toolbox Engineering
  671.                              |          Sound Manager Expert
  672. Apple Computer, Inc.         | "All opinions expressed are mine, and do
  673. 20525 Mariani Ave. MS: 81-KS |   not necessarily represent those of my
  674. Cupertino, CA 95014          |       employer, Apple Computer Inc."
  675.  
  676. +++++++++++++++++++++++++++
  677.  
  678. From: ksand@apple.com (Kent Sandvik)
  679. Date: 24 Mar 92 04:50:22 GMT
  680. Organization: MacDTS Mongols
  681.  
  682. In article <NICK.92Mar12123859@vaila.ed.ac.uk>, nick@dcs.ed.ac.uk (Nick
  683. Rothwell) writes:
  684. > In article <21230@goofy.Apple.COM> ksand@apple.com (Kent Sandvik) writes:
  685. >    The unofficial and official DTS standpoint is that *never* assume that
  686. >    an FPU is installed. Use Gestalt to check for this, now and forever.
  687. > Er, but: can you always assume that *Gestalt* is installed on all
  688. > machines? :-)
  689.  
  690. Inofficially speaking 6.0.4 upwards and A/UX 2.0 onwards. Yes, it does
  691. not cover 128k Macs.
  692.  
  693. Cheers,
  694. Kent
  695. - --
  696. Kent Sandvik/DTS - Dynamic Language Evangelist.
  697. Opinions expressed are private, and not owned by any company, 
  698. organization or group. Happy happy, joy joy!
  699.  
  700. +++++++++++++++++++++++++++
  701.  
  702. From: chuq@Apple.COM (Chuq Von Rospach)
  703. Date: 24 Mar 92 05:32:42 GMT
  704. Organization: I is a writur
  705.  
  706. ksand@apple.com (Kent Sandvik) writes:
  707.  
  708. >In article <NICK.92Mar12123859@vaila.ed.ac.uk>, nick@dcs.ed.ac.uk (Nick
  709. >Rothwell) writes:
  710. >> Er, but: can you always assume that *Gestalt* is installed on all
  711. >> machines? :-)
  712.  
  713. >Inofficially speaking 6.0.4 upwards and A/UX 2.0 onwards. Yes, it does
  714. >not cover 128k Macs.
  715.  
  716. The blessed way of handling this is to use GetTrapAddress() on Gestalt and
  717. see if it's defined. If it is, use Gestalt(). If it's not, then you know
  718. you've got an old release of the OS.
  719.  
  720. Check out the Mark book, or the "Programming 7.0" book from Addison-Wesley
  721. for examples of how to do this cleanly (or I think there's a tech note, or
  722. maybe someone will post a code fragment. I would, if I had it handy)
  723.  
  724. - -- 
  725.             Chuq "IMHO" Von Rospach, Enterprise Products Support
  726.             chuq@apple.com | GEnie:CHUQ & MAC.BIGOT | ALink:CHUQ
  727.                Book Reviewer, Amazing Stories =+= Member, SFWA
  728.            Editor, OtherRealms =+= #include <standard/disclaimer.h>
  729.  
  730. A fact is a fact. An opinion is an opinion. Just because your opinion
  731. disagrees with the facts doesn't mean the facts are wrong.
  732.  
  733. +++++++++++++++++++++++++++
  734.  
  735. From: REEKES@applelink.apple.com (Jim Reekes)
  736. Date: 25 Mar 92 18:54:47 GMT
  737. Organization: Apple Computer, Inc.
  738.  
  739. In article <21891@goofy.Apple.COM>, ksand@apple.com (Kent Sandvik) writes:
  740. > In article <64235@apple.Apple.COM>, chuq@Apple.COM (Chuq Von Rospach) writes:
  741. > > 
  742. > > ksand@apple.com (Kent Sandvik) writes:
  743. > > 
  744. > > >In article <NICK.92Mar12123859@vaila.ed.ac.uk>, nick@dcs.ed.ac.uk (Nick
  745. > > >Rothwell) writes:
  746. > > >> Er, but: can you always assume that *Gestalt* is installed on all
  747. > > >> machines? :-)
  748. > > 
  749. > > >Inofficially speaking 6.0.4 upwards and A/UX 2.0 onwards. Yes, it does
  750. > > >not cover 128k Macs.
  751. > > 
  752. > > The blessed way of handling this is to use GetTrapAddress() on Gestalt and
  753. > > see if it's defined. If it is, use Gestalt(). If it's not, then you know
  754. > > you've got an old release of the OS.
  755. > IM VI-3 has now the general information about Gestalt, TN129 will
  756. > only document changes which are not reflected in IM.
  757. > Here's the code from IM VI for detection of Gestalt:
  758. > FUNCTION GestaltAvailable: Boolean;
  759. > CONST
  760. >    _Gestalt = $A1AD;
  761. > BEGIN
  762. >    GestaltAvailable := TrapAvailable(_Gestalt);
  763. > END
  764. > ...and IM mentions that MPW 3.2 has glue for detection of Gestalt
  765. > when you call Gestalt functions, but those are not available for
  766. > asm hacking (naturally).
  767.  
  768. They most certainly are available for assembly coding.  Instead of calling
  769. the trap _Gestalt, you simply JSR GESTALT.  This will then call
  770. the glue/library routine that is the same thing high level programmers use.
  771.  
  772. This libarary routine will first check if the _Gestalt trap is available.
  773. If you are using the JSR method in assembly, or calling Gestalt from a
  774. high level language you do not need to check if the trap is implemented.
  775. Unless you compile you Pascal or C program with -d SystemSevenOrLater.
  776. In this case, you are using the inline version of the interface and this
  777. does not use the glue routine.
  778.  
  779. - -----------------------------------------------------------------------
  780. Jim Reekes, E.O.             |     Macintosh Toolbox Engineering
  781.                              |          Sound Manager Expert
  782. Apple Computer, Inc.         | "All opinions expressed are mine, and do
  783. 20525 Mariani Ave. MS: 81-KS |   not necessarily represent those of my
  784. Cupertino, CA 95014          |       employer, Apple Computer Inc."
  785.  
  786. +++++++++++++++++++++++++++
  787.  
  788. From: ksand@apple.com (Kent Sandvik)
  789. Date: 25 Mar 92 17:29:39 GMT
  790. Organization: MacDTS Mongols
  791.  
  792. In article <64235@apple.Apple.COM>, chuq@Apple.COM (Chuq Von Rospach) writes:
  793. > ksand@apple.com (Kent Sandvik) writes:
  794. > >In article <NICK.92Mar12123859@vaila.ed.ac.uk>, nick@dcs.ed.ac.uk (Nick
  795. > >Rothwell) writes:
  796. > >> Er, but: can you always assume that *Gestalt* is installed on all
  797. > >> machines? :-)
  798. > >Inofficially speaking 6.0.4 upwards and A/UX 2.0 onwards. Yes, it does
  799. > >not cover 128k Macs.
  800. > The blessed way of handling this is to use GetTrapAddress() on Gestalt and
  801. > see if it's defined. If it is, use Gestalt(). If it's not, then you know
  802. > you've got an old release of the OS.
  803.  
  804. IM VI-3 has now the general information about Gestalt, TN129 will
  805. only document changes which are not reflected in IM.
  806.  
  807. Here's the code from IM VI for detection of Gestalt:
  808.  
  809. FUNCTION GestaltAvailable: Boolean;
  810. CONST
  811.    _Gestalt = $A1AD;
  812.  
  813. BEGIN
  814.    GestaltAvailable := TrapAvailable(_Gestalt);
  815. END
  816.  
  817. ..and IM mentions that MPW 3.2 has glue for detection of Gestalt
  818. when you call Gestalt functions, but those are not available for
  819. asm hacking (naturally).
  820.  
  821. Cheers,
  822. Kent
  823.  
  824. - --
  825. Kent Sandvik/DTS - Dynamic Language Evangelist.
  826. Opinions expressed are not private, and not owned by any company, organization
  827. or group. Happy happy, joy joy!
  828.  
  829. +++++++++++++++++++++++++++
  830.  
  831. From: time@ice.com (Tim Endres)
  832. Date: 27 Mar 92 15:07:02 GMT
  833. Organization: ICE Engineering, Inc.
  834.  
  835.  
  836. Did anyone ever answer the original question?
  837.  
  838. I know that Apple says, you can not, indeed SHOULD not, determine
  839. if MultiFinder is running. Well.... That is nice until you *need* to
  840. know if MF is running (I have found only one case so far).
  841.  
  842. Solution: I have devised a very simple method that seems to work.
  843.           I simply scan the Apple Menu Items for the word "MultiFinder",
  844.           which seems to be in the "About MultiFinder" for all Systems.
  845.           Of course, with System Seven the issue goes away, and so
  846.           does the "About MultiFinder" :)
  847.  
  848. tim.
  849.  
  850.  
  851. tim endres - time@ice.com  -or-  uupsi!tbomb!time
  852. ICE Engineering, Inc. - Phone (313) 449 8288 - FAX (313) 449-9208
  853. 8840 Main Street, Whitmore Lake, MI  48189
  854. USENET - a slow moving self parody... ph
  855.  
  856. +++++++++++++++++++++++++++
  857.  
  858. From: jmunkki@hila.hut.fi (Juri Munkki)
  859. Date: 28 Mar 92 09:31:19 GMT
  860. Organization: Helsinki University of Technology, Finland
  861.  
  862. In article <1CE00001.vh9261@tbomb.ice.com> time@ice.com (Tim Endres) writes:
  863. >Solution: I have devised a very simple method that seems to work.
  864. >          I simply scan the Apple Menu Items for the word "MultiFinder",
  865. >          which seems to be in the "About MultiFinder" for all Systems.
  866. >          Of course, with System Seven the issue goes away, and so
  867. >          does the "About MultiFinder" :)
  868.  
  869. It might work until someone goes and changes that menu item to something
  870. like "Tietoja: moniajojarjestelma". They haven't done that here, but I
  871. suppose that someone must have changed it, since it is possible.
  872.  
  873. Relying on a menu string to exist is an extremely bad practise.
  874.  
  875.    ____________________________________________________________________________
  876.   / Juri Munkki        /  Helsinki University of Technology   /  Wind  / Project /
  877.  / jmunkki@hut.fi  /  Computing Center Macintosh Support  /  Surf  / Arashi  /
  878.  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  879.  
  880. +++++++++++++++++++++++++++
  881.  
  882. From: time@ice.com (Tim Endres)
  883. Date: 28 Mar 92 23:56:46 GMT
  884. Organization: ICE Engineering, Inc.
  885.  
  886.  
  887. In article <1992Mar28.093119.10676@nntp.hut.fi> (comp.sys.mac.programmer), jmunkki@hila.hut.fi (Juri Munkki) writes:
  888. > In article <1CE00001.vh9261@tbomb.ice.com> time@ice.com (Tim Endres) writes:
  889. > >Solution: I have devised a very simple method that seems to work.
  890. > >          I simply scan the Apple Menu Items for the word "MultiFinder",
  891. > >          which seems to be in the "About MultiFinder" for all Systems.
  892. > >          Of course, with System Seven the issue goes away, and so
  893. > >          does the "About MultiFinder" :)
  894. > It might work until someone goes and changes that menu item to something
  895. > like "Tietoja: moniajojarjestelma". They haven't done that here, but I
  896. > suppose that someone must have changed it, since it is possible.
  897. > Relying on a menu string to exist is an extremely bad practise.
  898.  
  899. And having your code completely broken because you can not determine
  900. if the _Launch trap is going to return or not is even worse... As
  901. I originally posted:
  902.  
  903.     I know that Apple says, you can not, indeed SHOULD not, determine
  904.     if MultiFinder is running.
  905.  
  906. However, there are cases in which customers wish to break the rules
  907. with the understanding that they better not change the menu item :)
  908. Again, this is only for cases in which the programmer understands
  909. the implications.
  910.  
  911. tim.
  912.  
  913.  
  914. tim endres - time@ice.com  -or-  uupsi!tbomb!time
  915. ICE Engineering, Inc. - Phone (313) 449 8288 - FAX (313) 449-9208
  916. 8840 Main Street, Whitmore Lake, MI  48189
  917. USENET - a slow moving self parody... ph
  918.  
  919. +++++++++++++++++++++++++++
  920.  
  921. From: jcav@quads.uchicago.edu (JohnC)
  922. Organization: The Royal Society for Putting Things on Top of Other Things
  923. Date: Sun, 29 Mar 1992 07:25:14 GMT
  924.  
  925. In article <1CE00001.vksfey@tbomb.ice.com> time@ice.com (Tim Endres) writes:
  926. >And having your code completely broken because you can not determine
  927. >if the _Launch trap is going to return or not is even worse... As
  928. >I originally posted:
  929.  
  930. There is a Gestalt selector that returns this specific piece of
  931. information.  I don't know if the Gestalt glue will emulate that particular
  932. selector, but even if it does not, at least under System 6.0.4 or newer you
  933. _don't_ need to check for Multifinder in this particular situation.
  934.  
  935.  
  936. - -- 
  937. John Cavallino                  |  EMail: jcav@midway.uchicago.edu
  938. University of Chicago Hospitals |         John_Cavallino@uchfm.bsd.uchicago.edu
  939. Office of Facilities Management | USMail: 5841 S. Maryland Ave, MC 0953
  940. B0 f++ c+ g+ k s++ e+ h- pv     |         Chicago, IL  60637
  941.  
  942. +++++++++++++++++++++++++++
  943.  
  944. From: time@ice.com (Tim Endres)
  945. Date: 27 Mar 92 15:07:02 GMT
  946. Organization: ICE Engineering, Inc.
  947.  
  948.  
  949. Did anyone ever answer the original question?
  950.  
  951. I know that Apple says, you can not, indeed SHOULD not, determine
  952. if MultiFinder is running. Well.... That is nice until you *need* to
  953. know if MF is running (I have found only one case so far).
  954.  
  955. Solution: I have devised a very simple method that seems to work.
  956.           I simply scan the Apple Menu Items for the word "MultiFinder",
  957.           which seems to be in the "About MultiFinder" for all Systems.
  958.           Of course, with System Seven the issue goes away, and so
  959.           does the "About MultiFinder" :)
  960.  
  961. tim.
  962.  
  963.  
  964. tim endres - time@ice.com  -or-  uupsi!tbomb!time
  965. ICE Engineering, Inc. - Phone (313) 449 8288 - FAX (313) 449-9208
  966. 8840 Main Street, Whitmore Lake, MI  48189
  967. USENET - a slow moving self parody... ph
  968.  
  969. +++++++++++++++++++++++++++
  970.  
  971. From: jmunkki@hila.hut.fi (Juri Munkki)
  972. Date: 28 Mar 92 09:31:19 GMT
  973. Organization: Helsinki University of Technology, Finland
  974.  
  975. In article <1CE00001.vh9261@tbomb.ice.com> time@ice.com (Tim Endres) writes:
  976. >Solution: I have devised a very simple method that seems to work.
  977. >          I simply scan the Apple Menu Items for the word "MultiFinder",
  978. >          which seems to be in the "About MultiFinder" for all Systems.
  979. >          Of course, with System Seven the issue goes away, and so
  980. >          does the "About MultiFinder" :)
  981.  
  982. It might work until someone goes and changes that menu item to something
  983. like "Tietoja: moniajojarjestelma". They haven't done that here, but I
  984. suppose that someone must have changed it, since it is possible.
  985.  
  986. Relying on a menu string to exist is an extremely bad practise.
  987.  
  988.    ____________________________________________________________________________
  989.   / Juri Munkki        /  Helsinki University of Technology   /  Wind  / Project /
  990.  / jmunkki@hut.fi  /  Computing Center Macintosh Support  /  Surf  / Arashi  /
  991.  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  992.  
  993. +++++++++++++++++++++++++++
  994.  
  995. From: time@ice.com (Tim Endres)
  996. Date: 28 Mar 92 23:56:46 GMT
  997. Organization: ICE Engineering, Inc.
  998.  
  999.  
  1000. In article <1992Mar28.093119.10676@nntp.hut.fi> (comp.sys.mac.programmer), jmunkki@hila.hut.fi (Juri Munkki) writes:
  1001. > In article <1CE00001.vh9261@tbomb.ice.com> time@ice.com (Tim Endres) writes:
  1002. > >Solution: I have devised a very simple method that seems to work.
  1003. > >          I simply scan the Apple Menu Items for the word "MultiFinder",
  1004. > >          which seems to be in the "About MultiFinder" for all Systems.
  1005. > >          Of course, with System Seven the issue goes away, and so
  1006. > >          does the "About MultiFinder" :)
  1007. > It might work until someone goes and changes that menu item to something
  1008. > like "Tietoja: moniajojarjestelma". They haven't done that here, but I
  1009. > suppose that someone must have changed it, since it is possible.
  1010. > Relying on a menu string to exist is an extremely bad practise.
  1011.  
  1012. And having your code completely broken because you can not determine
  1013. if the _Launch trap is going to return or not is even worse... As
  1014. I originally posted:
  1015.  
  1016.     I know that Apple says, you can not, indeed SHOULD not, determine
  1017.     if MultiFinder is running.
  1018.  
  1019. However, there are cases in which customers wish to break the rules
  1020. with the understanding that they better not change the menu item :)
  1021. Again, this is only for cases in which the programmer understands
  1022. the implications.
  1023.  
  1024. tim.
  1025.  
  1026.  
  1027. tim endres - time@ice.com  -or-  uupsi!tbomb!time
  1028. ICE Engineering, Inc. - Phone (313) 449 8288 - FAX (313) 449-9208
  1029. 8840 Main Street, Whitmore Lake, MI  48189
  1030. USENET - a slow moving self parody... ph
  1031.  
  1032. +++++++++++++++++++++++++++
  1033.  
  1034. From: jcav@quads.uchicago.edu (JohnC)
  1035. Organization: The Royal Society for Putting Things on Top of Other Things
  1036. Date: Sun, 29 Mar 1992 07:25:14 GMT
  1037.  
  1038. In article <1CE00001.vksfey@tbomb.ice.com> time@ice.com (Tim Endres) writes:
  1039. >And having your code completely broken because you can not determine
  1040. >if the _Launch trap is going to return or not is even worse... As
  1041. >I originally posted:
  1042.  
  1043. There is a Gestalt selector that returns this specific piece of
  1044. information.  I don't know if the Gestalt glue will emulate that particular
  1045. selector, but even if it does not, at least under System 6.0.4 or newer you
  1046. _don't_ need to check for Multifinder in this particular situation.
  1047.  
  1048.  
  1049. - -- 
  1050. John Cavallino                  |  EMail: jcav@midway.uchicago.edu
  1051. University of Chicago Hospitals |         John_Cavallino@uchfm.bsd.uchicago.edu
  1052. Office of Facilities Management | USMail: 5841 S. Maryland Ave, MC 0953
  1053. B0 f++ c+ g+ k s++ e+ h- pv     |         Chicago, IL  60637
  1054.  
  1055. +++++++++++++++++++++++++++
  1056.  
  1057. From: time@ice.com (Tim Endres)
  1058. Date: 29 Mar 92 19:40:49 GMT
  1059. Organization: ICE Engineering, Inc.
  1060.  
  1061.  
  1062. In article <1992Mar29.072514.2700@midway.uchicago.edu> (comp.sys.mac.programmer), jcav@quads.uchicago.edu (JohnC) writes:
  1063. > In article <1CE00001.vksfey@tbomb.ice.com> time@ice.com (Tim Endres) writes:
  1064. > >And having your code completely broken because you can not determine
  1065. > >if the _Launch trap is going to return or not is even worse... As
  1066. > >I originally posted:
  1067. > There is a Gestalt selector that returns this specific piece of
  1068. > information.  I don't know if the Gestalt glue will emulate that particular
  1069. > selector, but even if it does not, at least under System 6.0.4 or newer you
  1070. > _don't_ need to check for Multifinder in this particular situation.
  1071.  
  1072. Not true! On some systems the Gestalt selector you refer to (gestaltOSAttr,
  1073. gestaltLaunchCanReturn BIT) is true EVEN when Finder is running.
  1074. This has caused me great pain under systems as late as 6.0.7!
  1075.  
  1076. tim.
  1077.  
  1078.  
  1079. tim endres - time@ice.com  -or-  uupsi!tbomb!time
  1080. ICE Engineering, Inc. - Phone (313) 449 8288 - FAX (313) 449-9208
  1081. 8840 Main Street, Whitmore Lake, MI  48189
  1082. USENET - a slow moving self parody... ph
  1083.  
  1084. +++++++++++++++++++++++++++
  1085.  
  1086. From: quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  1087. Organization: The University of Western Australia
  1088. Date: Mon, 30 Mar 1992 03:03:21 GMT
  1089.  
  1090. In article <1CE00001.vn1rg1@tbomb.ice.com>, time@ice.com (Tim Endres) writes:
  1091. > In article <1992Mar29.072514.2700@midway.uchicago.edu> (comp.sys.mac.programmer), jcav@quads.uchicago.edu (JohnC) writes:
  1092. > > 
  1093. > > There is a Gestalt selector that returns this specific piece of
  1094. > > information.  I don't know if the Gestalt glue will emulate that particular
  1095. > > selector, but even if it does not, at least under System 6.0.4 or newer you
  1096. > > _don't_ need to check for Multifinder in this particular situation.
  1097. > > 
  1098. > Not true! On some systems the Gestalt selector you refer to (gestaltOSAttr,
  1099. > gestaltLaunchCanReturn BIT) is true EVEN when Finder is running.
  1100. > This has caused me great pain under systems as late as 6.0.7!
  1101.  
  1102. And if you mix your MultiFinders and your systems (for example MultiFinder 6.1b9
  1103. and System 6.0.7) then the gestaltLaunchCanReturn bit returns false even if
  1104. launch will return.  Very annoying that one.
  1105.  
  1106. Quinn "The Eskimo!"   <quinn@cs.uwa.edu.au>  "Real Coke, Diet .sig"
  1107. Department of Computer Science, The University of Western Australia
  1108.  
  1109.  
  1110. +++++++++++++++++++++++++++
  1111.  
  1112. From: dorner@pequod.cso.uiuc.edu (Steve Dorner)
  1113. Organization: University of Illinois at Urbana-Champaign
  1114. Date: Mon, 30 Mar 1992 21:57:14 GMT
  1115.  
  1116. time@ice.com (Tim Endres) writes:
  1117. >          I simply scan the Apple Menu Items for the word "MultiFinder",
  1118. >          which seems to be in the "About MultiFinder" for all Systems.
  1119. >          Of course, with System Seven the issue goes away, and so
  1120. >          does the "About MultiFinder" :)
  1121.  
  1122. Try scanning the apple menu for the name of your application instead.
  1123. This will only fail if a) somebody has a DA named the same as your App
  1124. [pretty darn unlikely, and you could check for it anyway] or b) if
  1125. somebody renames your app while it's running [in which case they deserve
  1126. whatever they get]. This sidesteps the localization issue.
  1127.  
  1128. - -- 
  1129. Steve Dorner, U of Illinois Computing Services Office
  1130. Internet: s-dorner@uiuc.edu  UUCP: uunet!uiucuxc!uiuc.edu!s-dorner
  1131.  
  1132. +++++++++++++++++++++++++++
  1133.  
  1134. From: phils@chaos.cs.brandeis.edu (Phil Shapiro)
  1135. Date: 31 Mar 92 03:48:55 GMT
  1136. Organization: Symantec Corp.
  1137.  
  1138. >>>>> On Mon, 30 Mar 1992 21:57:14 GMT, dorner@pequod.cso.uiuc.edu (Steve Dorner) said:
  1139.  
  1140.  > Try scanning the apple menu for the name of your application
  1141.  > instead.  This will only fail if a) somebody has a DA named the
  1142.  > same as your App [pretty darn unlikely, and you could check for it
  1143.  > anyway] or b) if somebody renames your app while it's running [in
  1144.  > which case they deserve whatever they get]. This sidesteps the
  1145.  > localization issue.
  1146.  
  1147. Why not just test for the _OSDispatch (nee _JugglerDispatch) trap? For
  1148. example:
  1149.  
  1150.     #define OSDispatch  0xA88F
  1151.     #define UnImplTrap  0xA09F
  1152.     
  1153.     if (NGetTrapAddress(OSDispatch, ToolTrap) == 
  1154.         NGetTrapAddress(UnImplTrap, ToolTrap)) {
  1155.         // MF isn't present
  1156.     }
  1157.     else {
  1158.         // MF is present
  1159.     }
  1160.  
  1161.     -phil
  1162. - --
  1163.    Phil Shapiro                                   Software Engineer
  1164.    Language Products Group                     Symantec Corporation
  1165.            Internet: phils@cs.brandeis.edu
  1166.  
  1167. +++++++++++++++++++++++++++
  1168.  
  1169. From: time@ice.com (Tim Endres)
  1170. Date: 31 Mar 92 13:43:31 GMT
  1171. Organization: ICE Engineering, Inc.
  1172.  
  1173.  
  1174. In article <PHILS.92Mar30224855@chaos.cs.brandeis.edu> (comp.sys.mac.programmer), phils@chaos.cs.brandeis.edu (Phil Shapiro) writes:
  1175. > Why not just test for the _OSDispatch (nee _JugglerDispatch) trap? For
  1176. > example:
  1177. >    < code to check for trap deleted >
  1178. >
  1179.  
  1180. Finder can still be running with this trap present...
  1181.  
  1182.  
  1183. tim endres - time@ice.com  -or-  uupsi!tbomb!time
  1184. ICE Engineering, Inc. - Phone (313) 449 8288 - FAX (313) 449-9208
  1185. 8840 Main Street, Whitmore Lake, MI  48189
  1186. USENET - a slow moving self parody... ph
  1187.  
  1188. +++++++++++++++++++++++++++
  1189.  
  1190. From: Pete.Gontier@p811.f70.n109.z1.fidonet.org (Pete Gontier)
  1191. Date: 3 Apr 92 02:26:36 GMT
  1192.  
  1193.  
  1194.  TE> From: time@ice.com (Tim Endres)
  1195.  TE> In article <PHILS.92Mar30224855@chaos.cs.brandeis.edu>
  1196.  TE> (comp.sys.mac.programmer), phils@chaos.cs.brandeis.edu (Phil Shapiro)
  1197.  TE> writes:
  1198.  TE> > Why not just test for the _OSDispatch (nee _JugglerDispatch) trap? For
  1199.  TE> > example:
  1200.  TE> > 
  1201.  TE> >    < code to check for trap deleted >
  1202.  TE> 
  1203.  TE> Finder can still be running with this trap present...
  1204.  
  1205. Tim, I *know* this isn't true, unless something really strange has happened
  1206. in System 6.0.8 that I don't know about. I've watched MultiFinder implement
  1207. the trap. I've implemented it myself (by mistake) under Finder and watched
  1208. Apple apps check for MultiFinder by comparing my patch address with the 
  1209. unimplemented trap address. What makes you say this?
  1210.  
  1211. +++++++++++++++++++++++++++
  1212.  
  1213. From: time@ice.com (Tim Endres)
  1214. Date: 3 Apr 92 14:24:02 GMT
  1215. Organization: ICE Engineering, Inc.
  1216.  
  1217.  
  1218. In article <702291617.F00005@blkcat.UUCP> (comp.sys.mac.programmer), Pete.Gontier@p811.f70.n109.z1.fidonet.org (Pete Gontier) writes:
  1219. >  TE> From: time@ice.com (Tim Endres)
  1220. >  TE> In article <PHILS.92Mar30224855@chaos.cs.brandeis.edu>
  1221. >  TE> (comp.sys.mac.programmer), phils@chaos.cs.brandeis.edu (Phil Shapiro)
  1222. >  TE> writes:
  1223. >  TE> > Why not just test for the _OSDispatch (nee _JugglerDispatch) trap? For
  1224. >  TE> > example:
  1225. >  TE> > 
  1226. >  TE> >    < code to check for trap deleted >
  1227. >  TE> 
  1228. >  TE> Finder can still be running with this trap present...
  1229. > Tim, I *know* this isn't true, unless something really strange has happened
  1230. > in System 6.0.8 that I don't know about. I've watched MultiFinder implement
  1231. > the trap. I've implemented it myself (by mistake) under Finder and watched
  1232. > Apple apps check for MultiFinder by comparing my patch address with the 
  1233. > unimplemented trap address. What makes you say this?
  1234.  
  1235. A mistake made me say it (no! a little daemon made me do it! :).
  1236. Actually, it turns out that the code I had that made me think this
  1237. was broke. Therefore, I take back all I said and submit myself for
  1238. corrective action!
  1239.  
  1240. tim.
  1241.  
  1242.  
  1243. tim endres - time@ice.com  -or-  uupsi!tbomb!time
  1244. ICE Engineering, Inc. - Phone (313) 449 8288 - FAX (313) 449-9208
  1245. 8840 Main Street, Whitmore Lake, MI  48189
  1246. USENET - a slow moving self parody... ph
  1247.  
  1248. +++++++++++++++++++++++++++
  1249.  
  1250. From: amanda@visix.com (Amanda Walker)
  1251. Date: 3 Apr 92 01:26:24 GMT
  1252. Organization: Visix Software Inc., Reston, VA
  1253.  
  1254. phils@chaos.cs.brandeis.edu (Phil Shapiro) writes:
  1255. > Why not just test for the _OSDispatch (nee _JugglerDispatch) trap?
  1256.  
  1257. I believe that it is always present in Systems > 6.0.5...
  1258.  
  1259. Amanda Walker                        amanda@visix.com
  1260. Project Leader, Multiplatform Software Development
  1261. Visix Software Inc.                     +1 800 832 8668
  1262. - -- 
  1263. "If a man does not keep pace with his companions, perhaps it is because he
  1264.  hears a different drummer.  Let him march to the music he hears, be it
  1265.  however measured or far away."        --Henry David Thoreau
  1266.  
  1267. +++++++++++++++++++++++++++
  1268.  
  1269. From: f85-tno@nada.kth.se (Tommy Nordgren)
  1270. Date: 6 Apr 92 15:28:59 GMT
  1271. Organization: Royal Institute of Technology, Stockholm, Sweden
  1272.  
  1273. There is one very reliable way. Check for the presence of the OSDispatch trap,
  1274. used to allocate temporary memory from multifinder.
  1275.  
  1276. +++++++++++++++++++++++++++
  1277.  
  1278. From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  1279. Date: 6 Apr 92 21:16:58 GMT
  1280. Organization: Royal Institute of Technology, Stockholm, Sweden
  1281.  
  1282. .se> f85-tno@nada.kth.se (Tommy Nordgren) writes:
  1283.  
  1284.    There is one very reliable way. Check for the presence of the OSDispatch
  1285.    trap, used to allocate temporary memory from multifinder.
  1286.  
  1287. That is still not a reliable way. It tells you wether you can use
  1288. MF temp mem. It does NOT tell you wether _Launch will return.
  1289.  
  1290. However, the whole question is esoteric, since these days there's
  1291. no need to concern oneself about that; _LaunchApplication doesn't
  1292. need a wdRefNum, and DOES return. And if you need launching
  1293. capabilities, there's no reason not to use system software that's
  1294. been out for a ywar and the upgrade to which is free.
  1295.  
  1296. - -- 
  1297. h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
  1298.  
  1299. +++++++++++++++++++++++++++
  1300.  
  1301. From: jpugh@apple.com (Jon Pugh)
  1302. Date: 6 Apr 92 23:36:45 GMT
  1303. Organization: Apple Co.
  1304.  
  1305. > [going on about MultiFinder & Launch...]
  1306.  
  1307. Here's a totally skanky thing to do that no one should recommend, but might
  1308. solve your problems.  Taken in concert with the system version number, which
  1309. you are undoubtedly looking at, this should provide you with the knowledge
  1310. you want.  Simply look for the MultiFinder file in the System folder (the
  1311. name is actually stored in the System itself as a STR or STR# if you want
  1312. to be international.  If it is missing on systems that need it, it's not
  1313. running.  If it is there, open it.  If you get an error MultiFinder is 
  1314. running, otherwise it is not running.
  1315.  
  1316. How's that for a skanky hack?  Talk about assuming things...
  1317.  
  1318. Jon
  1319.  
  1320. Few things are harder to put up with than the annoyance of a good example.
  1321.  
  1322. +++++++++++++++++++++++++++
  1323.  
  1324. From: f85-tno@nada.kth.se (Tommy Nordgren)
  1325. Date: 6 Apr 92 15:28:59 GMT
  1326. Organization: Royal Institute of Technology, Stockholm, Sweden
  1327.  
  1328. There is one very reliable way. Check for the presence of the OSDispatch trap,
  1329. used to allocate temporary memory from multifinder.
  1330.  
  1331. +++++++++++++++++++++++++++
  1332.  
  1333. From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  1334. Date: 6 Apr 92 21:16:58 GMT
  1335. Organization: Royal Institute of Technology, Stockholm, Sweden
  1336.  
  1337. .se> f85-tno@nada.kth.se (Tommy Nordgren) writes:
  1338.  
  1339.    There is one very reliable way. Check for the presence of the OSDispatch
  1340.    trap, used to allocate temporary memory from multifinder.
  1341.  
  1342. That is still not a reliable way. It tells you wether you can use
  1343. MF temp mem. It does NOT tell you wether _Launch will return.
  1344.  
  1345. However, the whole question is esoteric, since these days there's
  1346. no need to concern oneself about that; _LaunchApplication doesn't
  1347. need a wdRefNum, and DOES return. And if you need launching
  1348. capabilities, there's no reason not to use system software that's
  1349. been out for a ywar and the upgrade to which is free.
  1350.  
  1351. - -- 
  1352. h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
  1353.  
  1354. +++++++++++++++++++++++++++
  1355.  
  1356. From: jpugh@apple.com (Jon Pugh)
  1357. Date: 6 Apr 92 23:36:45 GMT
  1358. Organization: Apple Co.
  1359.  
  1360. > [going on about MultiFinder & Launch...]
  1361.  
  1362. Here's a totally skanky thing to do that no one should recommend, but might
  1363. solve your problems.  Taken in concert with the system version number, which
  1364. you are undoubtedly looking at, this should provide you with the knowledge
  1365. you want.  Simply look for the MultiFinder file in the System folder (the
  1366. name is actually stored in the System itself as a STR or STR# if you want
  1367. to be international.  If it is missing on systems that need it, it's not
  1368. running.  If it is there, open it.  If you get an error MultiFinder is 
  1369. running, otherwise it is not running.
  1370.  
  1371. How's that for a skanky hack?  Talk about assuming things...
  1372.  
  1373. Jon
  1374.  
  1375. Few things are harder to put up with than the annoyance of a good example.
  1376.  
  1377. +++++++++++++++++++++++++++
  1378.  
  1379. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  1380. Date: 9 Apr 92 16:41:56 +1200
  1381. Organization: University of Waikato, Hamilton, New Zealand
  1382.  
  1383. In article <22452@goofy.Apple.COM>, jpugh@apple.com (Jon Pugh) writes:
  1384. >> [going on about MultiFinder & Launch...]
  1385. >
  1386. > Here's a totally skanky thing to do that no one should recommend, but might
  1387. > solve your problems.  Taken in concert with the system version number, which
  1388. > you are undoubtedly looking at, this should provide you with the knowledge
  1389. > you want.  Simply look for the MultiFinder file in the System folder (the
  1390. > name is actually stored in the System itself as a STR or STR# if you want
  1391. > to be international.  If it is missing on systems that need it, it's not
  1392. > running.  If it is there, open it.  If you get an error MultiFinder is
  1393. > running, otherwise it is not running.
  1394. >
  1395. > How's that for a skanky hack?  Talk about assuming things...
  1396.  
  1397. Certainly is skanky. I don't recall the name of the MultiFinder file
  1398. being stored anywhere in the System though; I thought only the Finder had to
  1399. know what its name was, so it could set it as the startup application.
  1400.  
  1401. But why bother thinking up all these elaborate techniques? Just check
  1402. for the presence of the OSDispatch/JugglerDispatch trap ($A88F). It's the
  1403. technique Apple themselves use. You can't get any simpler, or more reliable,
  1404. than that.
  1405.  
  1406. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  1407. Computer Services Dept                     fax: +64-7-838-4066
  1408. University of Waikato            electric mail: ldo@waikato.ac.nz
  1409. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00
  1410.  
  1411. +++++++++++++++++++++++++++
  1412.  
  1413. From: ivanski@world.std.com (Ivan M CaveroBelaunde)
  1414. Date: 9 Apr 92 12:09:19 GMT
  1415. Organization: The World Public Access UNIX, Brookline, MA
  1416.  
  1417. A technique that I've seen mentioned before is using Gestalt on gestaltOSAttr
  1418. ('os  '). One of the flags returned specify whether a Launch trap can return
  1419. to the caller (launchCanReturn or somesuch). I'm not sure, however, which
  1420. is the minimum system that supports this Gestalt selector.
  1421.  
  1422. Hope this helps,
  1423. - -Ivan
  1424. - ---
  1425. Ivan Cavero Belaunde
  1426. DiVA Corporation
  1427.  
  1428. +++++++++++++++++++++++++++
  1429.  
  1430. From: lsr@taligent.com (Larry Rosenstein)
  1431. Date: 9 Apr 92 19:27:23 GMT
  1432. Organization: Taligent, Inc.
  1433.  
  1434. In article <1992Apr9.164156.7341@waikato.ac.nz>, ldo@waikato.ac.nz (Lawrence
  1435. D'Oliveiro, Waikato University) writes:
  1436. > But why bother thinking up all these elaborate techniques? Just check
  1437. > for the presence of the OSDispatch/JugglerDispatch trap ($A88F). It's the
  1438. > technique Apple themselves use. You can't get any simpler, or more reliable,
  1439.  
  1440. As I recall, checking for the MF Temporary Memory calls requires more than
  1441. testing for the trap.  Didn't you also have to check a low-memory global to rule
  1442. out Switcher?
  1443. - --
  1444. Larry Rosenstein
  1445. Taligent, Inc.
  1446. lsr@taligent.com
  1447.  
  1448. +++++++++++++++++++++++++++
  1449.  
  1450. From: ksand@apple.com (Kent Sandvik)
  1451. Date: 10 Apr 92 22:56:50 GMT
  1452. Organization: MacDTS Mongols
  1453.  
  1454. In article <1992Apr9.164156.7341@waikato.ac.nz>, ldo@waikato.ac.nz (Lawrence
  1455. D'Oliveiro, Waikato University) writes:
  1456. > Certainly is skanky. I don't recall the name of the MultiFinder file
  1457. > being stored anywhere in the System though; I thought only the Finder had to
  1458. > know what its name was, so it could set it as the startup application.
  1459. > But why bother thinking up all these elaborate techniques? Just check
  1460. > for the presence of the OSDispatch/JugglerDispatch trap ($A88F). It's the
  1461. > technique Apple themselves use. You can't get any simpler, or more reliable,
  1462. > than that.
  1463.  
  1464. Sigh, I guess DTS is speaking in vain about not checking for MF presence.
  1465.  
  1466. Cheers,
  1467. Kent
  1468.  
  1469. +++++++++++++++++++++++++++
  1470.  
  1471. From: Pete.Gontier@p811.f70.n109.z1.fidonet.org (Pete Gontier)
  1472. Date: Fri, 10 Apr 1992 23:23:05 -0500
  1473.  
  1474.  JW> From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  1475.  
  1476.  JW> f85-tno@nada.kth.se (Tommy Nordgren) writes:
  1477.  
  1478.  JW> There is one very reliable way. Check for the presence of the
  1479.  JW> OSDispatch trap, used to allocate temporary memory from multifinder.
  1480.  JW> 
  1481.  JW> That is still not a reliable way. It tells you wether you can use
  1482.  JW> MF temp mem. It does NOT tell you wether _Launch will return.
  1483.  
  1484. It's not *officially* reliable. If System 6.0.9...6.0.10... implement
  1485. _OSDispatch when MultiFinder is not running, then you're right, this will
  1486. not be a reliable method.
  1487.  
  1488. However, a lot of Apple's own utilities use this method and would all have
  1489. to be tweaked. And *why* would Apple do such a thing? To foil this scheme?
  1490. System 6 is pretty much frozen as far as this sort of OS feature goes.
  1491. So, as far as I'm concerned, it's a reliable method. It even works under
  1492. System 7, though it's not necessary, as you go on to say...
  1493.  
  1494.  JW> However, the whole question is esoteric, since these days there's
  1495.  JW> no need to concern oneself about that; _LaunchApplication doesn't
  1496.  JW> need a wdRefNum, and DOES return. And if you need launching
  1497.  JW> capabilities, there's no reason not to use system software that's
  1498.  JW> been out for a ywar and the upgrade to which is free.
  1499.  
  1500. My company (Kiwi, not EC) is marketing a System 7 only utility. We've been
  1501. making some phone calls to registered users. A surprisingly large percentage
  1502. of them have actually *gone back to System 6* for compatibility reasons.
  1503. (Obviously those reasons haven't to do with our utility -- often it's a
  1504. printer driver or some fax INIT or something else they can't do without.)
  1505. System 6 is definitely not dead, folks.
  1506.  
  1507. +++++++++++++++++++++++++++
  1508.  
  1509. From: Pete.Gontier@p811.f70.n109.z1.fidonet.org (Pete Gontier)
  1510. Date: Fri, 10 Apr 1992 23:29:47 -0500
  1511.  
  1512.  JP> From: jpugh@apple.com (Jon Pugh)
  1513.  
  1514.  JP> Simply look for the MultiFinder file in the System folder (the
  1515.  JP> name is actually stored in the System itself as a STR or STR# if you want
  1516.  JP> to be international.) If it is missing on systems that need it, it's not
  1517.  JP> running.  If it is there, open it.  If you get an error MultiFinder is 
  1518.  JP> running, otherwise it is not running.
  1519.  
  1520. I used to do this when I wanted this info. Then I found out that you
  1521. could move a file between directories while it was open. MultiFinder's
  1522. icon could be sitting on the desktop and MF would happily keep running.
  1523.  
  1524. Obviously, no sane user would do such a thing, right? But when it means
  1525. crashing because you didn't think MF was running, well, it gets to look
  1526. a little less than paranoid. Besides, a user might think removing MF
  1527. from the System Folder has the same effect as removing an INIT, and he'd
  1528. be right, sort of.
  1529.  
  1530. Checking for the existence of _OSDispatch is much better. At least then
  1531. when Apple changes it in System 6.0.19, you'll know which system version
  1532. you break on.
  1533.  
  1534. +++++++++++++++++++++++++++
  1535.  
  1536. From: Pete.Gontier@p811.f70.n109.z1.fidonet.org (Pete Gontier)
  1537. Date: Fri, 10 Apr 1992 23:50:04 -0500
  1538.  
  1539.  IM> From: ivanski@world.std.com (Ivan M CaveroBelaunde)
  1540.  
  1541.  IM> A technique that I've seen mentioned before is using Gestalt on
  1542.  IM> gestaltOSAttr ('os  '). One of the flags returned specify whether
  1543.  IM> a Launch trap can return to the caller (launchCanReturn or somesuch).
  1544.  
  1545. This Gestalt selector is supported on any machine running the Process Manager,
  1546. which currently is found only in System 7.
  1547.  
  1548. +++++++++++++++++++++++++++
  1549.  
  1550. From: quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  1551. Organization: The University of Western Australia
  1552. Date: Mon, 13 Apr 1992 03:53:35 GMT
  1553.  
  1554. In article <702994046.F00006@blkcat.UUCP>,... writes:
  1555. >  IM> From: ivanski@world.std.com (Ivan M CaveroBelaunde)
  1556. >  IM> A technique that I've seen mentioned before is using Gestalt on
  1557. >  IM> gestaltOSAttr ('os  '). One of the flags returned specify whether
  1558. >  IM> a Launch trap can return to the caller (launchCanReturn or somesuch).
  1559. > This Gestalt selector is supported on any machine running the Process Manager,
  1560. > which currently is found only in System 7.
  1561.  
  1562. Rong.  It's *definitely* supported under System 6.0.7 (with MultiFinder).
  1563. I know! I have the technology! I have GestaltDA sitting in front of me!
  1564.  
  1565. Quinn "The Eskimo!"   <quinn@cs.uwa.edu.au>  "Real Coke, Diet .sig"
  1566. Department of Computer Science, The University of Western Australia
  1567.  
  1568.  
  1569. +++++++++++++++++++++++++++
  1570.  
  1571. From: f85-tno@nada.kth.se (Tommy Nordgren)
  1572. Date: 13 Apr 92 13:11:06 GMT
  1573. Organization: Royal Institute of Technology, Stockholm, Sweden
  1574.  
  1575. In article <65131@apple.Apple.COM>, lsr@taligent.com (Larry Rosenstein) writes:
  1576. |> In article <1992Apr9.164156.7341@waikato.ac.nz>, ldo@waikato.ac.nz (Lawrence
  1577. |> D'Oliveiro, Waikato University) writes:
  1578. |> > 
  1579. |> > But why bother thinking up all these elaborate techniques? Just check
  1580. |> > for the presence of the OSDispatch/JugglerDispatch trap ($A88F). It's the
  1581. |> > technique Apple themselves use. You can't get any simpler, or more reliable,
  1582. |> 
  1583. |> As I recall, checking for the MF Temporary Memory calls requires more than
  1584. |> testing for the trap.  Didn't you also have to check a low-memory global to rule
  1585. |> out Switcher?
  1586. |> --
  1587. |> Larry Rosenstein
  1588. |> Taligent, Inc.
  1589. |> lsr@taligent.com
  1590. The Switcher is **** OBSOLETE ***** there is probebly NO NEED to check for it.
  1591.  
  1592. +++++++++++++++++++++++++++
  1593.  
  1594. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  1595. Date: 14 Apr 92 05:27:24 GMT
  1596. Organization: University of Waikato, Hamilton, New Zealand
  1597.  
  1598. In article <65131@apple.Apple.COM>, lsr@taligent.com (Larry Rosenstein) writes:
  1599. > In article <1992Apr9.164156.7341@waikato.ac.nz>, ldo@waikato.ac.nz (Lawrence
  1600. > D'Oliveiro, Waikato University) writes:
  1601. >>
  1602. >> But why bother thinking up all these elaborate techniques? Just check
  1603. >> for the presence of the OSDispatch/JugglerDispatch trap ($A88F). It's the
  1604. >> technique Apple themselves use. You can't get any simpler, or more reliable,
  1605. >
  1606. > As I recall, checking for the MF Temporary Memory calls requires more than
  1607. > testing for the trap.  Didn't you also have to check a low-memory global to rule
  1608. > out Switcher?
  1609.  
  1610. Last I heard, Switcher didn't support JugglerDispatch, so unless you can
  1611. run both Switcher and MultiFinder at the same time, or there's been an update
  1612. to Switcher, the presence of this trap automatically rules out Switcher.
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621. :-)
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630. On a related note, I'd like to revive the term "Juggler" as a generic way
  1631. of referring to both the pre-System-7 MultiFinder and the System 7 Process
  1632. Manager. After all, "MultiFinder" seems a somewhat inappropriate term for
  1633. the latter. I know Apple couldn't use "Juggler" as a product name because
  1634. someone else had already trademarked it; but there's no problem with our using
  1635. it as a technical term, is there?
  1636.  
  1637. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  1638. Computer Services Dept                     fax: +64-7-838-4066
  1639. University of Waikato            electric mail: ldo@waikato.ac.nz
  1640. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00
  1641.  
  1642. +++++++++++++++++++++++++++
  1643.  
  1644. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  1645. Date: 14 Apr 92 05:47:22 GMT
  1646. Organization: University of Waikato, Hamilton, New Zealand
  1647.  
  1648. In article <22894@goofy.Apple.COM>, ksand@apple.com (Kent Sandvik) writes:
  1649. > Sigh, I guess DTS is speaking in vain about not checking for MF presence.
  1650.  
  1651. Sigh, I guess us poor programmers are speaking in vain when we keep repeating
  1652. all the old reasons for checking for MultiFinder. Here are a couple of obvious
  1653. ones:
  1654.  
  1655. * Determining whether you will keep running after launching another application
  1656. (other postings in this thread have indicated that the appropriate Gestalt
  1657. selector is unreliable);
  1658.  
  1659. * Determining whether the system heap is resizable, so applications with highly-
  1660. variable requirements for longer-term memory storage can do their allocation
  1661. there, and don't have to keep telling the user to readjust their partition
  1662. sizes.
  1663.  
  1664. All flames and lectures regarding the second reason will be autoforwarded to
  1665. /get/stuffed.
  1666.  
  1667. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  1668. Computer Services Dept                     fax: +64-7-838-4066
  1669. University of Waikato            electric mail: ldo@waikato.ac.nz
  1670. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00
  1671. This line intentionally left unfunny.
  1672.  
  1673. +++++++++++++++++++++++++++
  1674.  
  1675. From: resnick@cogsci.uiuc.edu (Pete Resnick)
  1676. Organization: University of Illinois at Urbana
  1677. Date: Tue, 14 Apr 1992 15:41:41 GMT
  1678.  
  1679. ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  1680.  
  1681. >* Determining whether you will keep running after launching another application
  1682. >(other postings in this thread have indicated that the appropriate Gestalt
  1683. >selector is unreliable);
  1684.  
  1685. OK, I've been following this entire thread and I still can't figure
  1686. this one out: Why would anyone *care* whether they will keep running
  1687. after they launch another application? I am just not sure what
  1688. functionality is being talked about.
  1689.  
  1690. pr
  1691. - --
  1692. Pete Resnick             (...so what is a mojo, and why would one be rising?)
  1693. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  1694. System manager - Cognitive Science Group, Beckman Institute, UIUC
  1695. Internet: resnick@cogsci.uiuc.edu
  1696.  
  1697. +++++++++++++++++++++++++++
  1698.  
  1699. From: phils@chaos.cs.brandeis.edu (Phil Shapiro)
  1700. Date: 15 Apr 92 14:34:08 GMT
  1701. Organization: Symantec Corp.
  1702.  
  1703. >>>>> On 14 Apr 92 17:47:22 +1200, ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) said:
  1704.  
  1705. I guess I missed the earier discussions. Why can't you use Gestalt for
  1706. these features? Specific reasons or examples would be nice.
  1707.  
  1708.  > * Determining whether you will keep running after launching another
  1709.  > application (other postings in this thread have indicated that the
  1710.  > appropriate Gestalt selector is unreliable);
  1711.  
  1712. gestaltOSAttr, response bit gestaltLaunchCanReturn
  1713.  
  1714.  > * Determining whether the system heap is resizable, so applications
  1715.  > with highly- variable requirements for longer-term memory storage
  1716.  > can do their allocation there, and don't have to keep telling the
  1717.  > user to readjust their partition sizes.
  1718.  
  1719. gestaltOSAttr, response bit gestaltSysZoneGrowable
  1720.  
  1721.     -phil
  1722. - --
  1723.    Phil Shapiro                                   Software Engineer
  1724.    Language Products Group                     Symantec Corporation
  1725.            Internet: phils@cs.brandeis.edu
  1726.  
  1727. +++++++++++++++++++++++++++
  1728.  
  1729. From: Keith_Rollin@taligent.com (Keith Rollin)
  1730. Date: 15 Apr 92 21:43:00 GMT
  1731. Organization: Taligent
  1732.  
  1733. In article <1992Apr14.154141.18702@ux1.cso.uiuc.edu>, resnick@cogsci.uiuc.edu
  1734. (Pete Resnick) writes:
  1735. > ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  1736. > >* Determining whether you will keep running after launching another
  1737. application
  1738. > >(other postings in this thread have indicated that the appropriate Gestalt
  1739. > >selector is unreliable);
  1740. > OK, I've been following this entire thread and I still can't figure
  1741. > this one out: Why would anyone *care* whether they will keep running
  1742. > after they launch another application? I am just not sure what
  1743. > functionality is being talked about.
  1744.  
  1745. If you sub-launch an application, you would like to know if you have to go
  1746. through the effort of saving the current state of any open documents. For
  1747. instance, say MacWrite has the ability to sub-launch applications. When I select
  1748. that menu item, I don't want MacWrite to ask me if I want to save any open
  1749. documents if Multi-Finder is running and the Launch call will return
  1750. immediately.
  1751.  
  1752. - --
  1753. Keith Rollin
  1754. Phantom Programmer
  1755. Taligent, Inc.
  1756.  
  1757. +++++++++++++++++++++++++++
  1758.  
  1759. From: John_Miller@mindlink.bc.ca (John Miller)
  1760. Date: 16 Apr 92 05:31:50 GMT
  1761. Organization: MIND LINK! - British Columbia, Canada
  1762.  
  1763. In message <702994046.F00004@blkcat.UUCP>,
  1764. Pete.Gontier@p811.f70.n109.z1.fidonet.org writes
  1765.  
  1766. > JP> From: jpugh@apple.com (Jon Pugh)
  1767. >
  1768. > JP> Simply look for the MultiFinder file in the System folder (the
  1769. > JP> name is actually stored in the System itself as a STR or > JP> STR# if
  1770. you want to be international.) If it is missing
  1771. > JP> on systems that need it, it's not running.  If it is there,
  1772. > JP> open it.  If you get an error MultiFinder is running, otherwise
  1773. > JP> it is not running.
  1774. >
  1775. >I used to do this when I wanted this info. Then I found out that
  1776. >you could move a file between directories while it was open.
  1777. >MultiFinder's icon could be sitting on the desktop and MF
  1778. > would happily keep running.
  1779. >
  1780. >Obviously, no sane user would do such a thing, right? But when it
  1781.  
  1782. Actually, the multimedia computing lab at a local community
  1783. college kept the MultiFinder file on the desktop.  The Macs were
  1784. set to boot under UniFinder.  If the user wanted to run
  1785. MultiFinder, the Command-Option-Double-Click trick was used.
  1786. (Of course, if someone had asked me if this was possible, I would
  1787. have wisely proclaimed "Don't be silly:  the MultiFinder file
  1788. *has* to be in the System Folder.")
  1789.  
  1790. So this is one example where the test would fail.  I have no idea
  1791. how many installations might use this trick, but it seems
  1792. like that the type of thing that might make its way into the
  1793. Tips column of magazines or user groups newsletters.
  1794.  
  1795. John Miller
  1796. Symplex Systems
  1797.  
  1798.  
  1799. +++++++++++++++++++++++++++
  1800.  
  1801. From: zee@fwi.uva.nl (Daniel M. van der Zee (I89))
  1802. Date: 16 Apr 92 14:48:58 GMT
  1803. Organization: FWI, University of Amsterdam
  1804.  
  1805. Maybe we should create a group 
  1806.      comp.sys.mac.programmer.find.out.if.multifinder.is.running
  1807.  
  1808. Daniel van der Zee
  1809. zee@fwi.uva.nl
  1810.  
  1811. +++++++++++++++++++++++++++
  1812.  
  1813. From: ts@cup.portal.com (Tim W Smith)
  1814. Date: 18 Apr 92 02:44:39 GMT
  1815. Organization: The Portal System (TM)
  1816.  
  1817. OK, here's a quick hack for checking for MF.  I haven't actually
  1818. tried it, though.
  1819.  
  1820. Add the size of the system heap and the size of the application heap.
  1821. If this is near the total size of memory, then assume no MF.  Otherwise,
  1822. assume MF.
  1823.  
  1824.                             Tim Smith
  1825.  
  1826. +++++++++++++++++++++++++++
  1827.  
  1828. From: Jeremiah.Blatz@dartmouth.edu (Jeremiah Blatz)
  1829. Date: 19 Apr 92 02:06:09 GMT
  1830. Organization: Dartmouth College, Hanover, NH
  1831.  
  1832. In article <57544@cup.portal.com>
  1833. ts@cup.portal.com (Tim W Smith) writes:
  1834.  
  1835. > Add the size of the system heap and the size of the application heap.
  1836. > If this is near the total size of memory, then assume no MF.  Otherwise,
  1837. > assume MF.
  1838.  
  1839. Okay, what about all of us who need more memory than we have (ever
  1840. tried rotating a large, 600 dpi bitmap in Canvas on a Mac+ w/Sys. 7)?
  1841. We allocate enough memory to our big programs to be sure that they get
  1842. every byte of memory we have.
  1843.  
  1844. Jeremiah
  1845. JerBl@Dartmouth.edu
  1846.  
  1847. +++++++++++++++++++++++++++
  1848.  
  1849. From: Joe.Francis@dartmouth.edu (Joe Francis)
  1850. Date: 20 Apr 92 03:08:55 GMT
  1851. Organization: Dartmouth College, Hanover, NH
  1852.  
  1853. In article <1992Apr14.154141.18702@ux1.cso.uiuc.edu>
  1854. resnick@cogsci.uiuc.edu (Pete Resnick) writes:
  1855.  
  1856. > OK, I've been following this entire thread and I still can't figure
  1857. > this one out: Why would anyone *care* whether they will keep running
  1858. > after they launch another application? I am just not sure what
  1859. > functionality is being talked about.
  1860.  
  1861. I'll tack a cut at this one.  Suppose you have an application which can
  1862. fetch other applications from a public server, put them on the users
  1863. mac, and launch them.  Further suppose that a normal use of this
  1864. program would be to do this several times - ie, you don't just want to
  1865. always quit after doing this once.  Further suppose that your program
  1866. uses MacTCP to talk to another server that tells it what things it can
  1867. fetch/launch, and where they might be.
  1868.  
  1869. One thing you DON'T want to do with MacTCP is quit without closing out
  1870. your connections.  If you do, your user will do rude things to you
  1871. involving (but not limited to) sharp objects.  Thus it's important to
  1872. know whether _Launch will terminate your existence.
  1873.  
  1874. This is a real life example, by the way, taken from my current work.  I
  1875. check OSDispatch.  Do it for your kids.
  1876.  
  1877. (In fact, in order to support IAC under system 6, I even find out which
  1878. version of MultiFinder I've got, but that's another story...)
  1879.  
  1880. +++++++++++++++++++++++++++
  1881.  
  1882. From: ts@cup.portal.com (Tim W Smith)
  1883. Date: Sun, 19 Apr 92 23:35:51 PDT
  1884. Organization: The Portal System (TM)
  1885.  
  1886. > > Add the size of the system heap and the size of the application heap.
  1887. > > If this is near the total size of memory, then assume no MF.  Otherwise,
  1888. > > assume MF.
  1889. > Okay, what about all of us who need more memory than we have (ever
  1890. > tried rotating a large, 600 dpi bitmap in Canvas on a Mac+ w/Sys. 7)?
  1891. > We allocate enough memory to our big programs to be sure that they get
  1892. > every byte of memory we have.
  1893.  
  1894. What does this have to do with checking for MF?  If you are not running
  1895. MF, you get all the memory, so adding system heap + application heap
  1896. should give you something close to the total size of memory.
  1897.  
  1898. If you are running MF, then Finder will be taking up a couple of hundred
  1899. K of memory, so adding the system heap and the application heap should
  1900. come up short of total memory, no matter what you've set the application
  1901. size to.
  1902.  
  1903.                             Tim Smith
  1904.  
  1905. +++++++++++++++++++++++++++
  1906.  
  1907. From: jxyh@lanl.gov (John H. Hall)
  1908. Date: 20 Apr 92 19:28:38 GMT
  1909. Organization: Los Alamos National Laboratory
  1910.  
  1911. > What does this have to do with checking for MF?  If you are not running
  1912. > MF, you get all the memory, so adding system heap + application heap
  1913. > should give you something close to the total size of memory.
  1914. > If you are running MF, then Finder will be taking up a couple of hundred
  1915. > K of memory, so adding the system heap and the application heap should
  1916. > come up short of total memory, no matter what you've set the application
  1917. > size to.
  1918. >                             Tim Smith
  1919. Don't some people in memory low situations (e.g. 4 MB MacPlus and system 7) have
  1920. an extension that closes Finder during an application launch. I thought I saw a
  1921. mention of one sometime back. This would probably mess up this attempt to 
  1922. locate MF's presence.
  1923.  
  1924. +++++++++++++++++++++++++++
  1925.  
  1926. From: nerm@apple.com (Dean Yu)
  1927. Date: 21 Apr 92 16:47:03 GMT
  1928. Organization: Apple Computer, Inc.
  1929.  
  1930. In article <57544@cup.portal.com>, ts@cup.portal.com (Tim W Smith) writes:
  1931. > OK, here's a quick hack for checking for MF.  I haven't actually
  1932. > tried it, though.
  1933. > Add the size of the system heap and the size of the application heap.
  1934. > If this is near the total size of memory, then assume no MF.  Otherwise,
  1935. > assume MF.
  1936.  
  1937.   This won't work if you're running MacsBug with a huge Debuggers Prefs
  1938. file, or other extensions that place themselves above BufPtr.
  1939.  
  1940.   -- Dean Yu
  1941.      Blue Meanie, Negative Ethnic Role Model, Window Cleaner,
  1942.       Skanky Hack Consultant, etc.
  1943.      Apple Computer, Inc.
  1944.  
  1945. +++++++++++++++++++++++++++
  1946.  
  1947. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  1948. Date: 23 Apr 92 17:13:18 +1200
  1949. Organization: University of Waikato, Hamilton, New Zealand
  1950.  
  1951. In article <65501@apple.Apple.COM>, Keith_Rollin@taligent.com (Keith Rollin) writes:
  1952. > In article <1992Apr14.154141.18702@ux1.cso.uiuc.edu>, resnick@cogsci.uiuc.edu
  1953. > (Pete Resnick) writes:
  1954. >>
  1955. >> OK, I've been following this entire thread and I still can't figure
  1956. >> this one out: Why would anyone *care* whether they will keep running
  1957. >> after they launch another application? I am just not sure what
  1958. >> functionality is being talked about.
  1959. >
  1960. > If you sub-launch an application, you would like to know if you have to go
  1961. > through the effort of saving the current state of any open documents.
  1962.  
  1963. Yup. And here's another related reason, with more nasty consequences:
  1964.  
  1965. On systems not running MultiFinder, if you don't close a file before you quit,
  1966. it don't get closed.
  1967.  
  1968. Lawrence "found this out the hard way" D'Oliveiro
  1969.  
  1970. +++++++++++++++++++++++++++
  1971.  
  1972. From: Jeremiah.Blatz@dartmouth.edu (Jeremiah Blatz)
  1973. Date: 25 Apr 92 19:21:11 GMT
  1974. Organization: Dartmouth College, Hanover, NH
  1975.  
  1976. In article <57649@cup.portal.com>
  1977. ts@cup.portal.com (Tim W Smith) writes:
  1978.  
  1979. > > Okay, what about all of us who need more memory than we have (ever
  1980. > > tried rotating a large, 600 dpi bitmap in Canvas on a Mac+ w/Sys. 7)?
  1981. > > We allocate enough memory to our big programs to be sure that they get
  1982. > > every byte of memory we have.
  1983. > What does this have to do with checking for MF?  If you are not running
  1984. > MF, you get all the memory, so adding system heap + application heap
  1985. > should give you something close to the total size of memory.
  1986.  
  1987. Sorry, I didn't mention that I quit the Finfer before launching any
  1988. RAM-hungry app. (via a tiny app. that launches an app. then quits).
  1989.  
  1990. Okay, here's my stab at checking for MF: present a dialog box at
  1991. program startup that apoligises (sp) for the inconvience and blames
  1992. Apple, then asks the user if they are running MultiFinder. If they
  1993. click "Yes" assume MF, If they click "No", no MF. You could add a
  1994. "Help" button explaining to the user that there will be a littlr
  1995. picture of a Macintosh on the right of the menu bar if they are running
  1996. MultiFinder.
  1997.  
  1998. Jeremiah
  1999.  
  2000. ---------------------------
  2001.  
  2002. End of C.S.M.P. Digest
  2003. **********************
  2004.